<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>重复渐变</title>
    <style>
        .box1{
            width: 300px;
            height: 300px;
            border: 10px solid gray;
            background: repeating-linear-gradient(red,green 10%, yellow 20%);
        }
        .box2{
            width: 300px;
            height: 300px;
            border: 10px solid gray;
            background: repeating-radial-gradient(red,green 10%, yellow 20%);
            margin-top: 20px;
        }
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
</body>
</html>